package com.invengo.testrfid.app.utils;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.widget.TextView;

import com.androidadvance.topsnackbar.TSnackbar;
import com.invengo.testrfid.R;

public class TSnackbarUtils {

    public static void showSnackbar(View chart, String info, final Context context) {

        final TSnackbar snackbar = TSnackbar
                .make(chart, "     " + info, TSnackbar.LENGTH_LONG);
        snackbar.setActionTextColor(Color.WHITE);
        snackbar.setDuration(200000);
        View snackbarView = snackbar.getView();
        snackbarView.setBackgroundColor(
                context.getResources().getColor(R.color.colorPrimary));
        TextView textView = (TextView) snackbarView.findViewById(com.androidadvance.topsnackbar.R.id.snackbar_text);
        textView.setTextColor(Color.WHITE);
        textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                snackbar.dismiss();
            }
        });
        snackbar.show();
    }
}
